const express = require("express");

const router = express.Router();

const expressJoi = require("@escook/express-joi");

const { getCategories,addCategories,getCategory,editCategory ,delCategory} = require("../control/categories");
// const {} = require("../schema/user");

//商品分类数据列表
router.get("/categories", getCategories);

//添加分类
router.post("/categories", addCategories);

//根据 id 查询分类
router.get("/categories/:id", getCategory);

//编辑提交分类
router.put("/categories/:id", editCategory);

//删除分类
router.delete("/categories/:id",delCategory)

module.exports = router;